import {
  wxRequest
} from '@/util/wxRequest'

// let env = '-test' // -dev 或者 -test
// const hosts = 'http://192.168.2.35:8080/'
// const hosts = 'http://127.0.0.1:9080/'
// const hosts = 'http://anmy.goktech.cn:8080/'
const hosts = 'https://anmy.goktech.cn/'

export const testRequest = (params) => wxRequest(params, hosts + 'api/mall/searchGoodsList')


export const code2Session = (params) => {
  return wxRequest(params, hosts + 'wxutil/WeiXinUserInfo/getSessionKeyOropenid')
}

//排行榜
export const annyRank =(parms) =>{
  return wxRequest(parms,hosts + 'f/ranking/ranking/ranking')
}
// 首页banner数据请求
export const homeBannerData = (params) => {
  return wxRequest(params, hosts + 'f/carousel/annyCarousel/showimag')
}

//首页公告
export const homeNotice = (params) => {
  return wxRequest(params, hosts + 'f/notice/annyNotice/nlmyqift')
}

// 首页分类
export const cateGoryData =  (params) => {
  return wxRequest(params, hosts + 'f/anny/prodcuct/productCommodity/cateGoryData')
}

// 首页我的店铺
export const annyShop =  (params) => {
  return wxRequest(params, hosts + 'f/anny/shop/annyShop/data')
}

// 注册店铺 
export const savaShop = (params) => {
  return wxRequest(params, hosts + 'f/anny/shop/annyShop/savaShop')
}

// 店铺销售额 querytodate
export const queryTodate = (params) => {
  return wxRequest(params, hosts + 'f/stock/annyinventory/querytodate')
}

// 首页进入商品详情
export const findDataList = (params) => {
  return wxRequest(params, hosts + 'f/anny/prodcuct/productCommodity/findDataList')
}

// 商品详情
export const findDataById = (params) => {
  return wxRequest(params, hosts + 'f/anny/prodcuct/productCommodity/findDataById')
}
// 浏览收藏下单商品
export const goodAddNum = (params) => {
  return wxRequest(params, hosts + 'f/anny/prodcuct/productCommodity/addNum')
}

//收藏商品or 收藏商店
export const goodsCollect = (params) => {
  return wxRequest(params, hosts + 'f/collect/annyCollect/saveAnnyCollect')
}

//判断商品/店铺是否收藏
export const judgeThis = (params) => {
  return wxRequest(params, hosts + 'f/collect/annyCollect/collectFlag')
}

//删除/取消收藏
export const deleteCollect = (params) => {
  return wxRequest(params, hosts + 'f/collect/annyCollect/deleteAll')
}


// 商品评论
export const goodsComment = (params) => {
  return wxRequest(params, hosts + 'f/anny/gen/genComments/phoneData')
}

//商品详情选择规格
export const chooseSize = (params) => {
  return wxRequest(params,hosts + 'f/anny/prodcuct/productCommodity/specificationsData')
}

//规格选择后详情
export const sizeDetail = (params) => {
  return wxRequest(params,hosts + 'f/anny/prodcuct/productCommodity/detailData')
}

// 加入购物车
export const saveShopCart = (params) => {
  return wxRequest(params, hosts + 'f/anny/shopcart/annyShopCart/saveShopCart')
}

// 购物车数据
export const shopCartData = (params) => {
  return wxRequest(params, hosts + 'f/anny/shopcart/annyShopCart/shopCartData')
}

// 修改购物车数据
export const updateShopCart = (params) => {
  return wxRequest(params, hosts + 'f/anny/shopcart/annyShopCart/updateShopCart')
}

// 删除购物车数据
export const deleteAll = (params) => {
  return wxRequest(params, hosts + 'f/anny/shopcart/annyShopCart/deleteAll')
}

// 购物车下单
export const addOrder = (params) => {
  return wxRequest(params, hosts + 'f/order/annyOrder/addOrder')
}

// 直接下单
export const directAddOrder = (params) => {
  return wxRequest(params, hosts + 'f/order/annyOrder/directAddOrder')
}

//我的 页面
export const mineMsg = (params) =>{
    return wxRequest(params,hosts + 'f/anny/wxuser/mypage/show')
}

//我的 收藏
export const mineCollect = (params) =>{
  return wxRequest(params,hosts + 'f/collect/annyCollect/collectData')
}
// 会员区数据接口
export const findFictitiousData = (params) => {
  return wxRequest(params, hosts+'f/anny/prodcuct/productCommodity/findFictitiousData')
}
// 积分商品数据接口
export const findListByEvaluate = (params) => {
  return wxRequest(params, hosts+'f/anny/prodcuct/productCommodity/findListByEvaluate')
}

// 签到赚积分
export const signIntegral = (params) => {
  return wxRequest(params, hosts+'f/anny/stream/annyStream/signIntegral')
}
// 判断当日是否签到
export const signIntegralFlag = (params) => {
  return wxRequest(params, hosts+'f/anny/stream/annyStream/signIntegralFlag')
}
//进入我的订单
export const orderList = (params) => {
  return wxRequest(params, hosts+'f/order/annyOrder/phoneData')
}

//我的订单—申请退款
export const annyOrderrefundApply = (params) => {
  return wxRequest(params, hosts+'f/order/annyOrderrefundApply')
}

//我的订单—确认收货
export const orderComplete = (params) => {
  return wxRequest(params, hosts+'f/order/annyOrder/orderComplete')
}

// 积分明细
export const userOperatin = (params) => {
  return wxRequest(params, hosts + 'f/anny/stream/annyStream/userOperatin')
}

// 首页会员数据
export const findFictitiousById =  (params) => {
  return wxRequest(params, hosts + 'f/anny/prodcuct/productCommodity/findFictitiousById')
}

// 积分下单 addIntegralOrder
export const addIntegralOrder =  (params) => {
  return wxRequest(params, hosts + 'f/order/annyOrder/addIntegralOrder')
}
// 线下 附近商家
export const nearShops = (params) => {
  return wxRequest(params, hosts + 'f/anny/shop/annyShop/dataNear')
}

// 线下 店铺分类
export const shopsClassify = (params) => {
  return wxRequest(params, hosts + 'f/anny/shop/annyShop/cateGoryData')
}

// 线下 店铺详情
export const shopMsg = (params) => {
  return wxRequest(params, hosts + 'f/anny/shop/annyShop/dataById')
}

// 线下 店铺列表
export const shopLists = (params) => {
  return wxRequest(params, hosts + 'f/anny/shop/annyShop/data')
}

// 获取当前店铺上下加商品统计
export const countGoodsByShopId = (params) => {
  return wxRequest(params, hosts + 'f/anny/prodcuct/productCommodity/countGoodsByShopId')
}

// 积分商品支付接口
export const addFictitiousOrder = (params) => {
  return wxRequest(params, hosts + 'f/order/annyOrder/addFictitiousOrder')
}

// 我的店铺里店铺管理
export const shopManage = (params) => {
  return wxRequest(params, hosts + 'f/anny/shop/annyShop/data')
}

// 线上店铺详细数据
export const dataByWxOpenId = (params) => {
  return wxRequest(params, hosts + 'f/anny/shop/annyShop/dataByWxOpenId')
}

// 资讯信息
export const getMsgList = (params) => {
  return wxRequest(params, hosts + 'f/anny/notice/annyInformation/data')
}
// 资讯详情
export const getMsgDetail = (params) => {
  return wxRequest(params, hosts + 'f/anny/notice/annyInformation/info')
}
// 绑定手机
export const bindPhone = (params) => {
  return wxRequest(params, hosts + 'wxutil/WeiXinUserInfo/getPhone')
}
// 抽奖
export const findActivityInfoList = (params) => {
  return wxRequest(params, hosts + 'f/anny/activity/findActivityInfoList')
}
// 抽奖奖品数据
export const findReWardList = (params) => {
  return wxRequest(params, hosts + 'f/anny/activity/findReWardList')
}
// 抽奖奖品数据
export const saveActivityRecord = (params) => {
  return wxRequest(params, hosts + 'f/anny/activity/saveActivityRecord')
}
// 抽奖次数
export const activityRecordFlag = (params) => {
  return wxRequest(params, hosts + 'f/anny/activity/activityRecordFlag')
}
// 抽奖次数
export const findRecordList = (params) => {
  return wxRequest(params, hosts + 'f/anny/activity/findRecordList')
}
// 关于我们
export const aboutMe = (params) => {
  return wxRequest(params, hosts + 'f/anny/aboutus/annyAboutUs/detail')
}